﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using AntEditor.Models;
using AntEditor.Models.Material;
using Gods.Foundation;

namespace AntEditor.ViewModels
{
    public class CurrentAccountViewModel : NotificationObject
    {
        private Account _account;

        public Account Account
        {
            get { return _account; }
            set
            {
                _account = value;
                AccountName = _account.Name ?? string.Empty;
            }
        }

        private string _accountName = string.Empty;

        public string AccountName
        {
            get { return _accountName; }
            set
            {
                _accountName = value;
                RaisePropertyChanged("AccountName");
            }
        }

        public void Init()
        {
            var accounts = ModelServicesManager.Instance.MaterialService.GetAccounts();

            Account = accounts.FirstOrDefault();
        }
    }
}
